/*
 * OrderLineItem class is responsible for:
 * looking up a DrinkSpec info
 * knowing drink quantity
 * calculating extended price 
 * calculating final price after Smps
 */
package Model;

public class OrderLineItem {
    private DrinkSpec drinkSpec;
    private int quantity;
    
    //constructor    
    public OrderLineItem(DrinkSpec drinkSpec, int quantity ){
        this.drinkSpec = drinkSpec;
        this.quantity = quantity;
    }
   
    //setter getter
    public DrinkSpec getDrinkSpec() {
        return drinkSpec;
    }

    public void setDrinkSpec(DrinkSpec drinkSpec) {
        this.drinkSpec = drinkSpec;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    
    public double getSubTotal(){
        return quantity * drinkSpec.getPrice();
    }
}
